<?php
// +----------------------------------------------------------------------
// | ThinkCMF [ WE CAN DO IT MORE SIMPLE ]
// +----------------------------------------------------------------------
// | Copyright (c) 2019 http://www.qbt8.com All rights reserved.
// +----------------------------------------------------------------------
// | Author: 章顺 <http://www.qbt8.com>
// +----------------------------------------------------------------------
namespace plugins\qbt_huaxin;
use cmf\lib\Plugin;
use think\Config;
use think\db;

class QbtHuaxinPlugin extends Plugin
{

    public $info = [
        'name'        => 'QbtHuaxin',
        'title'       => '华信短信验证码',
        'description' => '千佰特手机短信',
        'status'      => 1,
        'author'      => '千佰特',
        'version'     => '1.0',
        'demo_url'    => 'http://www.qbt8.com',
        'author_url'  => 'http://www.qbt8.com',
    ];

    public $hasAdmin = 1;//插件是否有后台管理界面

    /**
     * 插件安装
     * @return bool
     */
    public function install()
    {
        //加入配置项
        $options = [
            'account'=> '',
            'password'=>'',
            'content'=>'',
        ];
        cmf_set_option('huaxin_sms', $options);
        return true;
    }

    /**
     * 插件卸载
     * @return bool
     */
    public function uninstall()
    {
        //删除配置项
        Db::name('option')->where("option_name","huaxin_sms")->delete();
        return true;
    }
}